package cn.loioi.web.controller.admin.user;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.loioi.multi.mysql.model.SysResource;
import cn.loioi.multi.service.user.SysResourceService;
import cn.loioi.web.common.BaseJqGridController;

/**
 * <br>
 * (c) Copyright 2016 by <br>
 * @description :资源管理 <br>
 * @file_name :ResourceContorller.java <br>
 * @system_name :multi_project_web <br>
 * @author :yyzh <br>
 * @创建时间 :2016年7月26日 下午1:43:28
 */
@Controller
@RequestMapping("/admin/user/resource")
public class ResourceContorller extends BaseJqGridController<SysResource, SysResourceService> {

	@Autowired
	public ResourceContorller(SysResourceService service) {
		super("admin/user/resource/", "user:resource", service);
	}

	/**
	 * 获取父级菜单列表
	 * @param request
	 * @param model
	 * @return
	 */
	@ResponseBody
	@RequestMapping("root.json")
	public Model getRootResource(HttpServletRequest request, Model model) {
		return renderList(baseService.selectRootResource(), model);
	}
}
